home *** CD-ROM | disk | FTP | other *** search
/ Eagles Nest BBS 5 / Eagles_Nest_Mac_Collection_Disc_5.TOAST / Science & Religion / MacAtoms301 / MacAtoms301 / MacAtoms 3.0.1.rsrc / TEXT_2000_PS.txt < prev    next >
Text File  |  1990-10-30  |  1KB  |  74 lines

  1. %% Copyright Hilary D. Jones, 1989-1990
  2. /out {print flush} def
  3. (Setting up.\n) out
  4. /unit.matrix [1 0 0 1 0 0] def
  5. /inFile (%stdin) (r) file def
  6. /getToken {inFile token pop} bind def
  7. /getCopies { /#copies #copies def } bind def
  8. /getTypes { /numTypes getToken def } bind def
  9. /getRadii {
  10.     /radii numTypes array def
  11.     /diam numTypes array def
  12.     0 1 numTypes 1 sub { radii exch getToken put } for
  13.     0 1 numTypes 1 sub { diam exch dup radii exch get 2 mul 1 add put } for
  14. } bind def
  15. /getRow {
  16.     exch dup 3 -1 roll getToken put
  17. } bind def
  18. /getData {
  19.     dup diam exch get array
  20.     exch diam exch get 1 sub 0 exch 1 exch
  21.     {getRow } for
  22. } bind def
  23. /getPictures {
  24.     /idat numTypes array def
  25.     0 1 numTypes 1 sub {idat exch dup getData put} for
  26. } bind def
  27. /row {
  28.     idat aType get
  29.     nrow get
  30.     /nrow nrow 1 add def
  31. } bind def
  32. /border {
  33.     newpath
  34.     radii exch get dup dup 0 360 arc
  35.     closepath
  36. } bind def
  37. /pim {
  38.     gsave
  39.     translate
  40.     /aType exch def
  41.     aType border clip
  42.     /nrow 0 def
  43.     diam aType get dup 1
  44.     unit.matrix
  45.     { row }
  46.     image
  47.     grestore
  48. } bind def
  49. /plotOne {
  50.     getToken
  51.     dup radii exch get dup
  52.     getToken exch sub
  53.     exch getToken exch sub
  54.     pim
  55. } bind def
  56. /plotAtoms {
  57.     1 1 getToken {pop plotOne} for
  58. } bind def
  59. /doit {
  60.     gsave
  61.     initgraphics
  62.     unit.matrix setmatrix
  63.     getCopies
  64.     getTypes
  65.     getRadii
  66.     (Transferring image data.\n) out
  67.     getPictures
  68.     (Rendering images\n) out
  69.     plotAtoms
  70.     grestore
  71. } bind def
  72. (Setup complete\n) out
  73. doit
  74.